package action;

import java.util.List;

import model.TBook;
import model.TLocation;
import impl.TBookDAOimpl;
import impl.locationimpl;
import DAO.location;

import com.alibaba.fastjson.JSON;
import com.opensymphony.xwork2.ActionSupport;
/**
 * 图书搜索类
 * @author Administrator
 *
 */
@SuppressWarnings("serial")
public class selectBook extends BaseAction {
	TBookDAOimpl tbd=new TBookDAOimpl();
	private String link;
	
	public TBookDAOimpl getTbd() {
		return tbd;
	}

	public void setTbd(TBookDAOimpl tbd) {
		this.tbd = tbd;
	}

	public String getLink() {
		return link;
	}

	public void setLink(String link) {
		this.link = link;
	}

	/**
	 * @return
	 */
	public String execute() {
		List<TBook> slist=tbd.selectBook(link);//查询成功
		String json=JSON.toJSONString(slist);
		System.out.println(json);
		if (slist==null&&slist.equals("")) {
			return ERROR;
		} else {
			session.setAttribute("fileList", slist);
			return SUCCESS;//跳转成功
		}
		
	}
}